package systemEntity

import (
	"github.com/goravel/framework/database/orm"
	"goravel/app/models/common"
)

type Site struct {
	orm.Model
	Pid            uint            `gorm:"column:pid;type:int(11);" form:"pid" json:"pid"`
	Branchcode     string          `gorm:"column:branchcode;type:varchar(255);not null;unique" form:"branchcode" json:"branchcode"`
	Branchname     string          `gorm:"column:branchname;type:varchar(255);not null" form:"branchname" json:"branchname"`
	Shopcode       string          `gorm:"column:shopcode;type:varchar(255);not null;unique" form:"shopcode" json:"shopcode"`
	Contactaddress string          `gorm:"column:contactaddress;type:varchar(255);not null" form:"contactaddress" json:"contactaddress"`
	Dutyperson     string          `gorm:"column:dutyperson;type:varchar(255);not null" form:"dutyperson" json:"dutyperson"`
	Dutypersonnum  string          `gorm:"column:dutypersonnum;type:varchar(255);not null" form:"dutypersonnum" json:"dutypersonnum"`
	Wechat         string          `gorm:"column:wechat;type:varchar(255);" form:"wechat" json:"wechat"`
	Description    string          `gorm:"column:description;type:varchar(255);" form:"description" json:"description"`
	UserID         uint            `gorm:"column:user_id;" form:"user_id" json:"user_id"`
	Status         int             `gorm:"column:status;default:1;comment:状态" form:"status" json:"status"`
	Coordinates    common.CoordRes `gorm:"column:coordinates;null;comment:坐标" form:"coordinates" json:"coordinates"`
	Appkey         string          `gorm:"column:appkey;type:varchar(255);not null;unique" form:"appkey" json:"appkey"`
	Appsecret      string          `gorm:"column:appsecret;type:varchar(255);not null;unique" form:"appsecret" json:"appsecret"`
	Children       []Site          `gorm:"foreignKey:Pid;references:ID"  form:"children" json:"children"` //关联子组织
	orm.SoftDeletes
}
